﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Newtonsoft.Json.Linq;

namespace NetDisk_WebService
{
    public class UniValidate:IUniValidate
    {


        #region IUniValidate 成员
        /// <summary>
        /// 没有错误{'code':'0','msg':'没有错误'}
        /// </summary>
        /// <param name="jsonDataMsg"></param>
        /// <returns></returns>
        public string NoError(string jsonDataMsg = "")
        {
            JObject jObject = new JObject();
            jObject["code"] = "0";
            jObject["msg"] = "没有错误";
            string message = jObject.ToString();
            if (jsonDataMsg != "")
            {
                jObject = new JObject();
                jObject["code"] = "0";
                jObject["msg"] = jsonDataMsg;
                message = jObject.ToString();
            }
            return message;
        }


        public string UnsupportedOpenApi(string message = "{'code':'400','msg':'不支持此接口'}")
        {
            return message;
        }

        public string NoPermissionToDoThisOperation(string message = "{'code':'4','msg':'没有权限执行此操作'}")
        {
            return message;
        }

        public string UnauthorizedClientIPAddress(string message = "{'code':'5','msg':'IP未授权'}")
        {
            return message;
        }

        public string DbQueryError(string message = "{'code':'31001','msg':'数据库查询错误'}")
        {
            return message;
        }

        public string DbConnectError(string message = "{'code':'31002','msg':'数据库连接错误'}")
        {
            return message;
        }

        public string UserNotExists(string message = "{'code':'31045','msg':'用户不存在'}")
        {
            return message;
        }

        public string ParamError(string message = "{'code':'31023','msg':'输入参数错误'}")
        {
            return message;
        }

        public string UserAlreadyExists(string message = "{'code':'31046','msg':'用户已经存在'}")
        {
            return message;
        }

        public string UserPasswordError(string message = "{'code':'31047','msg':'密码错误'}")
        {
            return message;
        }

        public string BcsError(string message = "{'code':'31025 ','msg':'后端存储错误'}")
        {
            return message;
        }

        public string UserIsNotLogin(string message = "{'code':'31042 ','msg':'用户未登陆'}")
        {
            return message;
        }

       

        public string DbResultSetIsEmpty(string message = "{'code':'31003','msg':'数据库返回空结果'}")
        {
            return message;
        }

        public string NetworkError(string message = "{'code':'31021','msg':'网络错误'}")
        {
            return message;
        }

        public string CanNotAccessServer(string message = "{'code':'31022','msg':'暂时无法连接服务器'}")
        {
            return message;
        }

        public string AppIdIsEmpty(string message = "{'code':'31024','msg':'app id为空'}")
        {
            return message;
        }

        public string WPUssussIsInvalid(string message = "{'code':'31041','msg':'用户的cookie不是合法的网盘cookie'}")
        {
            return message;
        }

        public string UserIsNotActive(string message = "{'code':'31043','msg':'用户未激活'}")
        {
            return message;
        }

        public string UserIsNotAuthorized(string message = "{'code':'31044','msg':'用户未授权'}")
        {
            return message;
        }

        public string FileAlreadyExists(string message = "{'code':'31061','msg':'文件已经存在'}")
        {
            return message;
        }

        public string FileNameIsInvalid(string message = "{'code':'31062','msg':'文件名非法'}")
        {
            return message;
        }

        public string FileParentPathDoesNotExist(string message = "{'code':'31063','msg':'文件父目录不存在'}")
        {
            return message;
        }

        public string FileIsNotAuthorized(string message = "{'code':'31064','msg':'无权访问此文件'}")
        {
            return message;
        }

        public string DirectoryIsFull(string message = "{'code':'31065','msg':'目录已满'}")
        {
            return message;
        }

        public string FileDoesNotExist(string message = "{'code':'31066','msg':'文件不存在'}")
        {
            return message;
        }

        public string FileDealFailed(string message = "{'code':'31067','msg':'文件处理出错'}")
        {
            return message;
        }

        public string FileCreateFailed(string message = "{'code':'31068','msg':'文件创建失败'}")
        {
            return message;
        }

        public string FileCopyFailed(string message = "{'code':'31069','msg':'文件拷贝失败'}")
        {
            return message;
        }

        public string FileDeleteFailed(string message = "{'code':'31070','msg':'文件删除失败'}")
        {
            return message;
        }

        public string GetFileMetaFailed(string message = "{'code':'31071','msg':'不能读取文件元信息'}")
        {
            return message;
        }

        public string FileMoveFailed(string message = "{'code':'31072','msg':'文件移动失败'}")
        {
            return message;
        }

        public string FileRenameFailed(string message = "{'code':'31073','msg':'文件重命名失败'}")
        {
            return message;
        }

        public string AccessDeniedToSetQuota(string message = "{'code':'31110','msg':'未授权设置此目录配额'}")
        {
            return message;
        }

        public string AuotaOnlySopport2LevelDirectories(string message = "{'code':'31111','msg':'配额管理只支持两级目录'}")
        {
            return message;
        }

        public string ExceedQuota(string message = "{'code':'31112','msg':'超出配额'}")
        {
            return message;
        }

        public string TheQuotaIsBiggerThanOneOfItsParentDirectorys(string message = "{'code':'31113','msg':'配额不能超出目录祖先的配额'}")
        {
            return message;
        }

        public string TheQuotaIsSmallerThanOneOfItsSubDirectorys(string message = "{'code':'31114','msg':'配额不能比子目录配额小'}")
        {
            return message;
        }

        public string ThumbnailTailedInternalError(string message = "{'code':'31141','msg':'请求缩略图服务失败'}")
        {
            return message;
        }

        public string AccessTokenInvalidOrNoLongerValid(string message = "{'code':'110','msg':'Access Token不正确或者已经过期'}")
        {
            return message;
        }

        public string SignatureError(string message = "{'code':'31201','msg':'签名错误'}")
        {
            return message;
        }

        public string FileMd5NotFound(string message = "{'code':'31079','msg':'未找到文件MD5，请使用上传API上传整个文件'}")
        {
            return message;
        }

        public string ServerInternalError(string message = "{'code':'31209','msg':'服务器错误'}")
        {
            return message;
        }

        public string NotImplement(string message = "{'code':'31210','msg':'服务器不支持'}")
        {
            return message;
        }

        public string AccessDenied(string message = "{'code':'31211','msg':'禁止访问'}")
        {
            return message;
        }

        public string ServiceUnavailable(string message = "{'code':'31213','msg':'服务不可用'}")
        {
            return message;
        }

        public string StorageExceedLimit(string message = "{'code':'31218','msg':'容量超出限额'}")
        {
            return message;
        }

        public string RequestExceedLimit(string message = "{'code':'31219','msg':'请求数超出限额'}")
        {
            return message;
        }

        public string TransferExceedLimit(string message = "{'code':'31220','msg':'流量超出限额'}")
        {
            return message;
        }

        public string DirectorCanNotCopyLimit(string message = "{'code':'31221','msg':'文件夹不做复制功能'}")
        {
            return message;
        }

        #endregion
    }
}